package com.bosintek.wordtest;

public class WordSet {
	private String word;
	private String meaning;
	private boolean marked;

	public WordSet() {
		this.word = "";
		this.meaning = "";
		this.setMarked(false);
	}

	public WordSet(String word, String meaning) {
		this.word = word;
		this.meaning = meaning;
		this.setMarked(false);
	}

	public String getWord() {
		return word;
	}

	public void setWord(String word) {
		this.word = word;
	}

	public String getMeaning() {
		return meaning;
	}

	public void setMeaning(String meaning) {
		this.meaning = meaning;
	}

	public boolean equals(WordSet wset) {
		if (wset.getWord().toLowerCase().trim()
				.equals(word.toLowerCase().trim())
				&& wset.getMeaning().toLowerCase().trim()
						.equals(meaning.toLowerCase().trim())) {
			return true;
		}
		return false;
	}

	public String toXML() {
		String XML = "";
		XML += "\n<wset>";
		XML += "\n<word>";
		XML += this.word;
		XML += "\n</word>";
		XML += "\n<meaning>";
		XML += this.meaning;
		XML += "\n</meaning>";
		XML += "\n</wset>";
		return XML;
	}

	public boolean isMarked() {
		return marked;
	}

	public void setMarked(boolean marked) {
		this.marked = marked;
	}
}
